import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        component: () => import("@/views/home/index.vue"),
        meta: {
            title: "首页",
        },
    },
    {
        path: "/record",
        component: () => import("@/views/record/index.vue"),
        meta: {
            title: "记录",
        },
    },
    {
        path: "/record/:id",
        component: () => import("@/views/record/list/RecordDetails.vue"),
        meta: {
            title: "记录",
        }
    },
    {
        path: "/agree",
        component: () => import("@/views/agree/index.vue"),
        meta: {
            title: "约起",
        },
    },
    {
        path: "/special",
        component: () => import("@/views/agree/special/index.vue"),
        meta: {
            title: "专栏",
        },
    },
    {
        path: "/special/:id",
        component: () => import("@/views/agree/special/AgreeDetails.vue"),
        meta: {
            title: "专栏",
        }
    },
    {
        path: "/study",
        component: () => import("@/views/study/index.vue"),
        meta: {
            title: "学习",
        },
    },
    {
        path: "/release",
        component: () => import("@/views/release/index.vue"),
        meta: {
            title: "发布",
        },
    },
    {
        path: "/set",
        component: () => import("@/views/set/index.vue"),
        meta: {
            title: "设置",
        },
    },
    {
        path: "/share",
        component: () => import("@/views/share/index.vue"),
        meta: {
            title: "分享",
        },
    },
    {
        path: "/oauth/login/gitee",
        component: () => import("@/components/Oauth/index.vue"),
    },
    {
        path: "/oauth/login/github",
        component: () => import("@/components/Oauth/index.vue"),
    },
    {
        path: "/404",
        component: () => import("@/views/error/404.vue"),
        meta: {
            title: "404",
        },
    },
    {path: "/:catchAll(.*)", redirect: "/404"},
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
